package com.wwwarehouse.taskcenter.fragment.choose;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.wwwarehouse.common.activity.base.BaseActivity;
import com.wwwarehouse.common.activity.base.BaseFragment;
import com.wwwarehouse.common.custom_widget.ElasticScrollView;
import com.wwwarehouse.taskcenter.R;

/**
 * author ：minifly
 * date: 2017/9/20
 * time: 15:22
 * desc:
 */
public class ChooseGoodsFragment extends BaseFragment {

    private View mView;
    private EditText mEtGoodSku;
    private ImageView mChooceImg1;
    private View mChooceLineView;
    private ImageView mChooceImg2;
    private TextView mChooceText1;
    private TextView mChooceText2;
    private ElasticScrollView mElasticScroll;
    private Context mcontext;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        mView = inflater.inflate(R.layout.fragment_choose_pick, container, false);
        return mView;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initView();
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        mcontext = context;
    }

    public void initView() {

        mEtGoodSku = (EditText) mView.findViewById(R.id.chooce_edittext);
        mChooceImg1 = (ImageView) mView.findViewById(R.id.chooce_img_1);
        mChooceLineView = (View) mView.findViewById(R.id.chooce_line_view);
        mChooceImg2 = (ImageView) mView.findViewById(R.id.chooce_img_2);
        mChooceText1 = (TextView) mView.findViewById(R.id.chooce_text1);
        mChooceText2 = (TextView) mView.findViewById(R.id.chooce_text2);
        mElasticScroll = (ElasticScrollView) mView.findViewById(R.id.elastic_scroll);
//        button = (Button) mView.findViewById(R.id.chooce_btn);
//
//        button.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                ViewGroup.LayoutParams params =mChooceLineView.getLayoutParams();
//                params.height = ConvertUtils.dip2px(mcontext,60);
//                mChooceLineView.setLayoutParams(params);
//            }
//        });

        ((BaseActivity)mActivity).hideSoftByEditViewIds(new int[]{R.id.chooce_edittext});
//        ((BaseActivity)mActivity).filterViewByIds(new View[]{button});


    }


    @Override
    public void setTitle() {
        if (peekFragment() instanceof ChooseGoodsFragment) {
            mActivity.setTitle(getString(R.string.choose_pick));
        }
    }

    @Override
    public void requestDatas() {

    }


}
